package com.qiyu.admin.system.controller;

import com.qiyu.admin.system.model.QiYuSession;
import com.qiyu.admin.system.service.SessionService;
import com.qiyu.framework.util.PageBean;
import com.qiyu.framework.util.PagedResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * session管理
 *
 * @author zhangqing
 * @date 2017年03月24日
 */
@RestController
@RequestMapping(value = "session")
public class SessionController {

    @Resource
    private SessionService sessionService;
    @RequestMapping(value = "/view")
    public ModelAndView sessionListView(){
        return new ModelAndView("system/session/session_list");
    }


    @RequestMapping(value = "/page/list")
    public PagedResult<QiYuSession> sessionList(PageBean pageBean,QiYuSession qiYuSession) throws Exception {
        return sessionService.findPageList(pageBean.getPageNumber(),pageBean.getPageSize(),qiYuSession);
    }
}
